<template>
	<view class="classlist">
		<view class="content">
			<navigator :url="`/pages/preview/preview?image=${image || defaultImage}&category=${category}`" class="item"  >
				<image :src="image || defaultImage" mode="aspectFill" ></image>
			</navigator>
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue';

// 默认图片
const defaultImage = ref('/static/images/rw4.jpg');

defineProps({
	image:{
		type: String,
		required: true,
		default: ''
	},
	category:{
		type: String,
		required: true,
		default: ''
	},
})

</script>

<style lang="scss" scoped>
.classlist{
	.content{
		display: grid;
		grid-template-columns: repeat(3,1fr);
		gap: 5rpx;
		padding: 5rpx;
		.item{
			height: 440rpx;
			image{
				width: 100%;
				height: 100%;
				display: block;
			}
		}
	}
}

</style>